package com.study.talk.netty.message.response;

import com.study.common.annotation.Desc;
import com.study.talk.data.model.GroupInfo;
import com.study.talk.data.model.User;
import com.study.talk.data.model.UserInfo;
import com.study.talk.netty.message.MessageType;
import com.study.talk.netty.message.TalkMessage;

import java.util.List;

@Desc("登录消息响应")
public class LoginResponse extends TalkMessage {

    @Desc("用户id")
    private Integer userId;

    @Desc("用户账户")
    private String username;

    @Desc("用户是否登录成功")
    private Boolean success;

    @Desc("登录token")
    private String token;

    @Desc("原因")
    private String reason;

    @Desc("用户账号")
    private User user;

    @Desc("用户信息")
    private UserInfo userInfo;

    @Desc("用户好友列表")
    public List<UserInfo> friendList;

    @Desc("用户群聊列表")
    public List<GroupInfo> groupList;

    @Override
    public byte getType() {
        return MessageType.LOGIN_RESPONSE;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public UserInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }

    public List<UserInfo> getFriendList() {
        return friendList;
    }

    public void setFriendList(List<UserInfo> friendList) {
        this.friendList = friendList;
    }

    public List<GroupInfo> getGroupList() {
        return groupList;
    }

    public void setGroupList(List<GroupInfo> groupList) {
        this.groupList = groupList;
    }

    public LoginResponse(String dateTime, Integer userId, String username, Boolean success, String token, String reason, User user, UserInfo userInfo, List<UserInfo> friendList, List<GroupInfo> groupList) {
        super(dateTime);
        this.userId = userId;
        this.username = username;
        this.success = success;
        this.token = token;
        this.reason = reason;
        this.user = user;
        this.userInfo = userInfo;
        this.friendList = friendList;
        this.groupList = groupList;
    }

    public LoginResponse() {
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }
}
